|CCH.inc 
|v0.01 
#event OneBefore "#*#|${beforeMe}${beforeMe}${beforeMe}|#*#" 
#event TwoBefore "#*#|${twoBefore}${twoBefore}${twoBefore}|#*#" 
#event Rampage "#*# goes on a RAMPAGE!" 
#event CCH "[MQ2] CCH Mode Activated -- #1# #2# #3# #4# #5# #6#" 
#event EndCCH "[MQ2] Ending Chain CH" 
#event EndCCH "You have been slain by#*#" 

Sub CCHPreReqs 
/declare DoCCH   timer outer 
/declare CHEnd   timer outer 0 
/declare Rampage bool  outer FALSE 
/declare EndCCH  bool  outer FALSE 
/declare Delay   int   outer 

/if (${Version.NotEqual[${Ini[MyClericini,Misc,Version]}]}) /goto :LoadAliases 
/if (${MacroQuest.BuildDate.Equal[${Ini[MyCleric_${Me.Name}.ini,Misc,LoadDate]}]}) /goto :SkipAliases 
:LoadAliases 
/squelch /alias /CCHMode /echo CCH Mode Activated -- 
/squelch /alias /CCHEnd /echo Ending Chain CH 
:SkipAliases 
    
/return 

Sub event_CCH(Line,TankOne,TankTwo,MyNum,beforeMe,twoBefore,int delay) 
/stick off 
/delay 5 !${Me.Moving} 
/varset Rampage FALSE 
/varset Delay ${delay} 
/varset DoCCH 200000 
/varset EndCCH FALSE 

  :Loop 
   /if (${Me.Casting.ID}) { 
      /doevents OneBefore 
      /doevents TwoBefore 
      /goto :Loop 
   } 
   /if (${Bool[${Spawn[pc ${TankOne}]}]}) { 
      /target pc ${TankOne} 
   } else { 
      /varset TankOne ${TankTwo} 
   } 
   /doevents OneBefore 
   /doevents TwoBefore 
   /doevents Rampage 
   /doevents EndCCH 
   /doevents Died 
   /if (${EndCCH}) /return 
   /if (${Rampage} && ${HitTimer}>90) /rs RAMPAGE [${Me.Name}] RAMPAGE 
   /if (${DoCCH}==0) { 
      /varset DoCCH 200000 
     :CCHLoop 
      /if (${Target.Distance}<115) { 
         /cast "Complete Healing" 
         /delay 5 ${Bool[${Me.Casting.ID}]} 
         /if (!${Bool[${Me.Casting.ID}]}) /goto :CCHLoop 
         /varset CHEnd 100 
         |/g <${MyNum}${MyNum}${MyNum}> [ %t ] 
         /rsay <${MyNum}${MyNum}${MyNum}> [ %t ] 

          
      } else /if (${Target.Distance}<230) { 
         /echo Tank was out of Range for that cycle!! Waiting 7.5 Seconds and Casting Fast Heal.. 
         /varset CHEnd 100 
         /g <${MyNum}${MyNum}${MyNum}> [ %t ] 
         /delay 75 
         /call CastSpell "${RemedyMsg}" "${CasterHS}" spell "" 
      } 
   } 
   /goto :Loop 
/return 

Sub event_EndCCH 
   /varset EndCCH TRUE 
/return 

Sub event_TwoBefore 
   /if (${CHEnd}<${Math.Calc[${Delay}*1.8].Int}) /varset DoCCH ${Math.Calc[${Delay}*1.7].Int} 
/return 

Sub Event_OneBefore 
   /if (${CHEnd}<${Math.Calc[${Delay}*1.1].Int}) /varset DoCCH ${Delay} 
/return 

Sub Event_Rampage 
   /varset RT TRUE 
   /timed 16 /varset RT FALSE 
/return